﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using QLT_Public;
namespace QLT_Data
{
    public class ThongKe_Data
    {
        KetNoiCSDL_Data kn = new KetNoiCSDL_Data();
        public DataTable LayDuLieu()
        {
            return kn.LayDuLieu("ThongKe_LoaiThuoc");
        }
        public DataTable taoBang(string sql)
        {
            return kn.taoBang(sql);
        }
        public DataTable Load_ThongKe_ThuocBan_TheoNgay()
        {
            return kn.LayDuLieu("Load_ThongKe_ThuocBan_TheoNgay");
        }
        public DataTable ThongKe_ThuocBan_TheoNgay(CTHoaDonBH_Public ngay)
        {
            int n = 1;
            string[] name = new string[n];
            object[] value = new object[n];
            name[0] = "@NgayBan";
            value[0] = ngay.NgayBan;
            return kn.LayDuLieu("ThongKe_ThuocBan_TheoNgay",name,value,n);
        }
        public DataTable ChiTiet_ThongKe_LoaiThuoc(LoaiThuoc_Public ten)
        {
            int n = 1;
            string[] name = new string[n];
            object[] value = new object[n];
            name[0] = "@TenLoaiThuoc";
            value[0] = ten.TenLoaiThuoc;
            return kn.LayDuLieu("ChiTiet_ThongKe_LoaiThuoc", name, value, n);
        }
        public DataTable ChiTiet_TkeThuocNhap(LoaiThuoc_Public ten)
        {
            int n = 1;
            string[] name = new string[n];
            object[] value = new object[n];
            name[0] = "@TenLoaiThuoc";
            value[0] = ten.TenLoaiThuoc;
            return kn.LayDuLieu("ChiTiet_TKe_NhapTheoThang", name, value, n);
        }
        public DataTable ThongKe_ThuocQuaHan()
        {
            return kn.LayDuLieu("ThongKe_ThuocQuaHan");
        }
        public DataTable Load_ThongKe_DoanhThu_TheoThang()
        {
            return kn.LayDuLieu("Load_ThongKe_DoanhThu_TheoThang");
        }
        public DataTable ThongKe_DoanhThu_TheoThang(string m, string y)
        {
            int n = 2;
            string[] name = new string[n];
            object[] value = new object[n];
            name[0] = "@Thang";
            value[0] = m;
            name[1] = "@Nam";
            value[1] = y;
            return kn.LayDuLieu("ThongKe_DoanhThu_TheoThang", name, value, n);
        }
        public DataTable Load_ThongKe_ThuocNhapTheoThang()
        {
            return kn.LayDuLieu("Load_ThongKe_ThuocNhap_TheoThang");
        }
        public DataTable ThongKe_ThuocNhap_TheoThang(string m, string y)
        {
            int n = 2;
            string[] name = new string[n];
            object[] value = new object[n];
            name[0] = "@Thang";
            value[0] = m;
            name[1] = "@Nam";
            value[1] = y;
            return kn.LayDuLieu("ThongKe_ThuocNhap_TheoThang_2", name, value, n);
        }
        public DataTable Load_ThongKe_ThuocNhap()
        {
            return kn.LayDuLieu("Load_ThongKe_ThuocNhap");
        }
        public DataTable ThongKe_ThuocNhap_TheoThang_2(string m, string y)
        {
            int n = 2;
            string[] name = new string[n];
            object[] value = new object[n];
            name[0] = "@Thang";
            value[0] = m;
            name[1] = "@Nam";
            value[1] = y;
            return kn.LayDuLieu("ThongKe_ThuocNhap_TheoThang_2", name, value, n);
        }
    }
}
